package com.tmxk.api.days01.Ysc;

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
 * Collections算法类
 */
public class CollectionsDemo {
    public static void main(String[] args) {
        List<Integer>listNum=new LinkedList<>();
        listNum.add(1);
        listNum.add(12);
        listNum.add(13);
        listNum.add(14);
        listNum.add(15);
        listNum.add(16);
        System.out.println("集合最大值"+ Collections.max(listNum));
        System.out.println("集合最大值"+ Collections.min(listNum));
        System.out.println("listnum集合元素"+listNum);
        Collections.reverse(listNum);
        System.out.println(""+listNum);
        Collections.sort(listNum);
        System.out.println(""+listNum);
        Collections.reverse(listNum);
        System.out.println("");
        /**
         * Collection.reverse(listnum)
         * System.out.println(listNum)
         *
         * String类常用方法:
         * 1.equals()
         */
        int num=Collections.binarySearch(listNum,12);
    }
}
